#CC=gcc
#CXX=g++

#CPPUTEST_HOME=/usr/local
CPPUTEST_HOME=/var/fpwork/b2zhang/uphwapi/ut_build/cpputest-build

FLAGS= -c

CPPFLAGS += -I$(CPPUTEST_HOME)/include
CFLAGS += -include $(CPPUTEST_HOME)/include/CppUTest/MemoryLeakDetectorNewMacros.h
CXXFLAGS += -include $(CPPUTEST_HOME)/include/CppUTest/MemoryLeakDetectorMallocMacros.h

LD_LIBRARIES = -L$(CPPUTEST_HOME)/lib -lCppUTest -lCppUTestExt

TARGET=alltests

OBJECTS=AllTest.o code_ut.o
SOURCES=AllTest.cpp code_ut.cpp

$(TARGET):$(OBJECTS)
	$(CXX) $^ $(LD_LIBRARIES) -o $@

.cpp.o:
	$(CXX) $(FLAGS) $(CPPFLAGS) $(CXXFLAGS) $< -o $@

.c.o:
	$(CXX) $(FLAGS) $(CPPFLAGS) $(CFLAGS) $< -o $@

clean:
	rm *.o $(TARGET)
